package client;

import java.awt.Font;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.net.URL;

import javax.imageio.ImageIO;

/**
 * Loads any fonts or images used.
 * @author Robz
 *
 */
public class GraphicsLoader 
{
	private static String defaultPath="src\\client\\resources\\";
	private static Font largeFont= new Font("MagicMedieval", Font.BOLD, 18);
	private static Font smallFont = new Font("SansSerif", Font.BOLD, 16);
	
	public GraphicsLoader(){

	}
	
	public static BufferedImage loadImage(String filename){
		BufferedImage i;
		File file = new File(defaultPath+filename);
		try {
			i = ImageIO.read(file.toURL());
			//i = Toolkit.getDefaultToolkit().getImage(defaultPath+
			//		filename);
			//Toolkit.getDefaultToolkit().prepareImage(i, i.getWidth(null), i.getHeight(null), null);
			//i = (BufferedImage) i;
			return i;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public static Font getLargeFont() {
		return largeFont;
	}

	public static Font getSmallFont() {
		return smallFont;
	}
}
